package com.erbao.thread;

/**
 * @author CaoBaoYin
 * @since 2022/2/23 21:30
 */
public class SynchronizedMethod {
    public static void main(String[] args) {
        Child c = new Child();
        c.m();
    }
}

class Parent {
    public synchronized void m () {
        System.out.println("parent");
    }
}

class Child extends Parent {
    @Override
    public synchronized void m() {
        System.out.println("child");
        super.m();
    }
}

